package com.guan.ordering_sys.generator.controller;



import com.guan.ordering_sys.common.ResultApi;
import com.guan.ordering_sys.param.PageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.guan.ordering_sys.generator.service.EmployeeService;


/**
 * <p>
 *  EmployeeController 前端控制器
 * </p>
 *
 * @author 关远键
 * @version 1.0.3
 * @since 2021-06-18
 */
@Api(tags = "雇员控制器")
@RestController
@RequestMapping("/api/employee")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @ApiOperation("用户列表")
    @PostMapping("/getList")
    public ResultApi getList(PageParam pageParam) {
        return ResultApi.success(employeeService.getList(pageParam));
    }

    @ApiOperation("用户详情")
    @GetMapping("/getById/{id}")
    public ResultApi getById(@PathVariable("id") Long id) {
        return ResultApi.success(employeeService.getById(id));
    }

}

